package com.qezhhnjy.es.entity;

import cn.hutool.json.JSONUtil;
import lombok.Data;

/**
 * @author zhaoyangfu - 2021/4/9 18:16
 */
@Data
public class Shakespeare {

    private String type;
    private String lineId;
    private String playName;
    private String speechNumber;
    private String speaker;
    private String textEntry;


    private static final String json = "{\n" +
            "  \"type\": \"line\",\n" +
            "  \"line_id\": 16,\n" +
            "  \"play_name\": \"Henry IV\",\n" +
            "  \"speech_number\": 1,\n" +
            "  \"line_number\": \"1.1.13\",\n" +
            "  \"speaker\": \"KING HENRY IV\",\n" +
            "  \"text_entry\": \"And furious close of civil butchery\"\n" +
            "}";

    public static void main(String[] args) {
        Shakespeare shakespeare = JSONUtil.toBean(json, Shakespeare.class);
        System.out.println(shakespeare);
        System.out.println(JSONUtil.toJsonStr(shakespeare));
    }
}
